Java bytecode
part 7/9 Β· 28.3 KB total
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Execution
There are several Java virtual machines available today to execute Java
bytecode, both free and commercial products. If executing bytecode in a
virtual machine is undesirable, a developer can also compile Java source
code or bytecode directly to native machine code with tools such as the
GNU Compiler for Java (GCJ). Some processors can execute Java bytecode
natively. Such processors are termed Java processors.
Support for dynamic languages
The Java virtual machine provides some support for
dynamically typed languages. Most of the extant JVM instruction set is
statically typed - in the sense that method calls have their signatures
type-checked at compile time, without a mechanism to defer this decision
to run time, or to choose the method dispatch by an alternative
approach.cite-ref-12[12]
JSR 292 (Supporting Dynamically Typed Languages on the Java
Platform)cite-ref-13[13] added a new invokedynamic instruction at the JVM level, to
allow method invocation relying on dynamic type checking (instead of the
extant statically type-checked invokevirtual instruction). The
Da Vinci Machine is a prototype virtual machine implementation that
hosts JVM extensions aimed at supporting dynamic languages. All JVMs
supporting JSE 7 also include the invokedynamic opcode.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ